/*
 *    Copyright © OpenAtom Foundation.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package com.inspur.edp.bff.spi.assembler.builtin;

import com.inspur.edp.bff.api.manager.context.ModifyContext;
import com.inspur.edp.bff.spi.action.modify.AbstractModifyAction;
import com.inspur.edp.bff.spi.action.modify.AfterModifyAction;
import com.inspur.edp.bff.spi.action.modify.BeforeModifyAction;
import com.inspur.edp.bff.spi.assembler.AbstractExtendModifyAssembler;

import java.util.ArrayList;

public class DefaultExtendModifyAssembler extends AbstractExtendModifyAssembler {
    private ArrayList<BeforeModifyAction> beforeModifyActions;
    private ArrayList<AbstractModifyAction> modifyActions;
    private ArrayList<AfterModifyAction> afterModifyActions;

    @Override
    protected ArrayList<BeforeModifyAction> getBeforeModifyActions(ModifyContext modifyContext) {
        if (beforeModifyActions == null)
            beforeModifyActions = new ArrayList<>();
        return beforeModifyActions;
    }

    @Override
    protected ArrayList<AbstractModifyAction> getModifyActions(ModifyContext modifyContext) {
        if (modifyActions == null)
            modifyActions = new ArrayList<>();
        return modifyActions;
    }

    @Override
    protected ArrayList<AfterModifyAction> getAfterModifyActions(ModifyContext modifyContext) {
        if (afterModifyActions == null)
            afterModifyActions = new ArrayList<>();
        return afterModifyActions;
    }
}
